package com.online.shopping.service.impl;

import com.online.shopping.mapper.TbSellerMapper;
import com.online.shopping.pojo.TbSeller;
import com.online.shopping.pojo.TbSellerExample;
import com.online.shopping.service.TbSellerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TbSellerServiceImpl implements TbSellerService {

	@Autowired
	private TbSellerMapper sellerMapper;

	@Override
	public TbSeller findBySellerId(String sellerId) {
		System.out.println("用户名："+sellerId);

		TbSellerExample example = new TbSellerExample();
		TbSellerExample.Criteria criteria = example.createCriteria();

		criteria.andSellerIdEqualTo(sellerId);
		List<TbSeller> list = sellerMapper.selectByExample(example);

		if(list.size() > 0){
			return list.get(0);
		}
		return null;
	}
}
